package com.apress.gerber.mytest;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;

import com.apress.gerber.mytest.common.PlayerManager;
public class MainActivity extends Activity implements PlayerManager.PlayerStateListener{
    public static final String videoPath = Environment.getExternalStorageDirectory().getPath()+"/one.mp4";
    public static final String urlPath = "http://zv.3gv.ifeng.com/live/zhongwen800k.m3u8";
    private PlayerManager player;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initPlayer();
    }

    private void initPlayer() {
        player = new PlayerManager(this);
        player.setFullScreenOnly(true);
        player.setScaleType(PlayerManager.SCALETYPE_FILLPARENT);
        player.playInFullScreen(true);

        player.setPlayerStateListener(this);

        player.play(videoPath);

    }

    @Override
    public void onComplete() {

    }

    @Override
    public void onError() {

    }

    @Override
    public void onLoading() {

    }

    @Override
    public void onPlay() {

    }
}
